using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._CartographyTools._Generalization
{
    /// <summary>
    /// <para>Smooth Shared Edges</para>
    /// <para>Smooths the edges of the input features while maintaining the topological relationship with edges shared with other features.</para>
    /// <para>平滑输入要素的边缘，同时保持与与其他要素共享的边的拓扑关系。</para>
    /// </summary>    
    [DisplayName("Smooth Shared Edges")]
    public class SmoothSharedEdges : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public SmoothSharedEdges()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_features">
        /// <para>Input Features</para>
        /// <para>The lines or polygons to be smoothed.</para>
        /// <para>要平滑的线或多边形。</para>
        /// </param>
        /// <param name="_algorithm">
        /// <para>Smoothing Algorithm</para>
        /// <para><xdoc>
        ///   <para>Specifies the smoothing algorithm.</para>
        ///   <bulletList>
        ///     <bullet_item>Polynomial Approximation with Exponential Kernel (PAEK)— Calculates a smoothed polygon that will not pass through the input polygon vertices. It is the acronym for Polynomial Approximation with Exponential Kernel. This is the default.</bullet_item><para/>
        ///     <bullet_item>Bezier interpolation—Fits Bezier curves between vertices. The resulting polygons pass through the vertices of the input polygons. This algorithm does not require a tolerance. Bezier curves will be approximated in the output.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定平滑算法。</para>
        ///   <bulletList>
        ///     <bullet_item>具有指数核的多项式近似 （PAEK） — 计算不会通过输入多边形顶点的平滑多边形。它是具有指数核的多项式近似的首字母缩写词。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>贝塞尔插值 （Bezier interpolation） - 拟合顶点之间的贝塞尔曲线。生成的多边形穿过输入多边形的顶点。此算法不需要容差。贝塞尔曲线将在输出中近似。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// </param>
        /// <param name="_tolerance">
        /// <para>Smoothing Tolerance</para>
        /// <para>Determines the degree of smoothing. A unit can be specified; if no unit is specified, the unit of the input will be used. This is only used for the PAEK algorithm. The parameter will not appear on the tool dialog box when Bezier interpolation is selected and, in scripting, a value of 0 must be used.</para>
        /// <para>确定平滑程度。可以指定单位;如果未指定单位，则将使用输入的单位。这仅用于 PAEK 算法。选择贝塞尔插值时，该参数将不会出现在工具对话框中，并且在脚本中必须使用值 0。</para>
        /// </param>
        public SmoothSharedEdges(List<object> _in_features, _algorithm_value _algorithm, string? _tolerance)
        {
            this._in_features = _in_features;
            this._algorithm = _algorithm;
            this._tolerance = _tolerance;
        }
        public override string ToolboxName => "Cartography Tools";

        public override string ToolName => "Smooth Shared Edges";

        public override string CallName => "cartography.SmoothSharedEdges";

        public override List<string> AcceptEnvironments => ["cartographicPartitions"];

        public override object[] ParameterInfo => [_in_features, _algorithm.GetGPValue(), _tolerance, _shared_edge_features, _in_barriers, _out_feature_class, _out_shared_edge_feature_class];

        /// <summary>
        /// <para>Input Features</para>
        /// <para>The lines or polygons to be smoothed.</para>
        /// <para>要平滑的线或多边形。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public List<object> _in_features { get; set; }


        /// <summary>
        /// <para>Smoothing Algorithm</para>
        /// <para><xdoc>
        ///   <para>Specifies the smoothing algorithm.</para>
        ///   <bulletList>
        ///     <bullet_item>Polynomial Approximation with Exponential Kernel (PAEK)— Calculates a smoothed polygon that will not pass through the input polygon vertices. It is the acronym for Polynomial Approximation with Exponential Kernel. This is the default.</bullet_item><para/>
        ///     <bullet_item>Bezier interpolation—Fits Bezier curves between vertices. The resulting polygons pass through the vertices of the input polygons. This algorithm does not require a tolerance. Bezier curves will be approximated in the output.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定平滑算法。</para>
        ///   <bulletList>
        ///     <bullet_item>具有指数核的多项式近似 （PAEK） — 计算不会通过输入多边形顶点的平滑多边形。它是具有指数核的多项式近似的首字母缩写词。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>贝塞尔插值 （Bezier interpolation） - 拟合顶点之间的贝塞尔曲线。生成的多边形穿过输入多边形的顶点。此算法不需要容差。贝塞尔曲线将在输出中近似。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Smoothing Algorithm")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public _algorithm_value _algorithm { get; set; }

        public enum _algorithm_value
        {
            /// <summary>
            /// <para>Polynomial Approximation with Exponential Kernel (PAEK)</para>
            /// <para>Polynomial Approximation with Exponential Kernel (PAEK)— Calculates a smoothed polygon that will not pass through the input polygon vertices. It is the acronym for Polynomial Approximation with Exponential Kernel. This is the default.</para>
            /// <para>具有指数核的多项式近似 （PAEK） — 计算不会通过输入多边形顶点的平滑多边形。它是具有指数核的多项式近似的首字母缩写词。这是默认设置。</para>
            /// </summary>
            [Description("Polynomial Approximation with Exponential Kernel (PAEK)")]
            [GPEnumValue("PAEK")]
            _PAEK,

            /// <summary>
            /// <para>Bezier interpolation</para>
            /// <para>Bezier interpolation—Fits Bezier curves between vertices. The resulting polygons pass through the vertices of the input polygons. This algorithm does not require a tolerance. Bezier curves will be approximated in the output.</para>
            /// <para>贝塞尔插值 （Bezier interpolation） - 拟合顶点之间的贝塞尔曲线。生成的多边形穿过输入多边形的顶点。此算法不需要容差。贝塞尔曲线将在输出中近似。</para>
            /// </summary>
            [Description("Bezier interpolation")]
            [GPEnumValue("BEZIER_INTERPOLATION")]
            _BEZIER_INTERPOLATION,

        }

        /// <summary>
        /// <para>Smoothing Tolerance</para>
        /// <para>Determines the degree of smoothing. A unit can be specified; if no unit is specified, the unit of the input will be used. This is only used for the PAEK algorithm. The parameter will not appear on the tool dialog box when Bezier interpolation is selected and, in scripting, a value of 0 must be used.</para>
        /// <para>确定平滑程度。可以指定单位;如果未指定单位，则将使用输入的单位。这仅用于 PAEK 算法。选择贝塞尔插值时，该参数将不会出现在工具对话框中，并且在脚本中必须使用值 0。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Smoothing Tolerance")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public string? _tolerance { get; set; }


        /// <summary>
        /// <para>Shared Edge Features</para>
        /// <para>Line or polygon features that will be smoothed along edges shared with input features. Other edges are not smoothed.</para>
        /// <para>将沿与输入要素共享的边平滑的线或面要素。其他边缘未平滑。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Shared Edge Features")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public List<object> _shared_edge_features { get; set; } = null;


        /// <summary>
        /// <para>Input Barrier Layers</para>
        /// <para>Point, line, or polygon features that act as barriers for smoothing. The smoothed features will not touch or cross barrier features.</para>
        /// <para>用作平滑障碍的点、线或面要素。平滑的要素不会接触或越过障碍要素。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Barrier Layers")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public List<object> _in_barriers { get; set; } = null;


        /// <summary>
        /// <para>Output Feature Class</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Feature Class")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _out_feature_class { get; set; }


        /// <summary>
        /// <para>Output Feature Class</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Feature Class")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public List<object> _out_shared_edge_feature_class { get; set; }


        public SmoothSharedEdges SetEnv(object cartographicPartitions = null)
        {
            base.SetEnv(cartographicPartitions: cartographicPartitions);
            return this;
        }

    }

}